package com.kwt.learn.hashcode;


public class HashCode01 {
    public static void main(String[] args) {

        String nihao = new String("nihao");
        String fds = new String("buhao");

        System.out.println(nihao.hashCode());
        System.out.println(fds.hashCode());
    }

    /**
     * 不同的字符串拥有相同的hashcode
     */
    public static void hashCodeTest() {
        System.out.println("Aa".hashCode()); // 2112
        System.out.println("BB".hashCode()); // 2112
        System.out.println("ABCDEa123abc".hashCode()); // 165374702
        System.out.println("ABCDFB123abc".hashCode()); // 165374702

    }
}
